package com.heima.utils.thread;

import com.heima.model.user.pojos.ApUser;

public class ApThreadLocalUtil {
    private final static ThreadLocal<ApUser> AP_USER_THREAD_LOCAL=new ThreadLocal<>();

    /**
     * 存放参数
     * @param apUser
     */
    public static void setApUser(ApUser apUser){
        AP_USER_THREAD_LOCAL.set(apUser);
    }

    /**
     * 获得参数
     * @return
     */
    public static ApUser getApUser(){
        return AP_USER_THREAD_LOCAL.get();
    }
    /**
     * 删除参数
     */
    public static void removeApUser(){
        AP_USER_THREAD_LOCAL.remove();
    }
}
